export function toState(key){
    let Enum={
        STOPPED: { key: 'default', value: '停止' },
        STARTED: { key: 'processing', value: '运行' },
        WAITING: { key: 'waiting', value: '等待' },
        PAUSED: { key: 'paused', value: '暂停' },
        UN_FINISHED: { key: 'error', value: '未完成' },
        FINISHED: { key: 'success', value: '完成' },
        FAILED: { key: 'error', value: '失败' },
    }
    let stateObj = Enum[key] ? Enum[key] : Enum.STOPPED;
    return stateObj;
}